AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include('shared.lua')

function ENT:Initialize()
	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( SOLID_VPHYSICS )

	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end

end
function ENT:PhysicsUpdate( physobj )
	local vel = physobj:GetVelocity()
	if self.passive and self.passive > 0 then
		if self.passive > 100 then self.passive = 100 end
		
		vel = vel * ((100.0 - self.passive)/100.0)
	end
	
	if self.braking and util.tobool(self.braking) and self.active > 0 then
		if self.active > 100 then self.active = 100 end

		vel = vel * ((100.0 - self.active)/100.0)
	end
	
	physobj:SetVelocity(vel)
end